package com.xm.servlet.background.home;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


/**
 * 退出登陆
 * @author 康文程
 * @date 2023-12-15 下午 04:22
 */
@WebServlet("/background/log/out")
public class LogOutServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)  {
        //删除令牌和账号ID
        HttpSession session = req.getSession();
        session.removeAttribute("csrfToken");
        session.removeAttribute("id");
    }
}
